<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="./vue.js"></script>
</head>
<body>

<div id="app">
    <a href="" @click.prevent="myClick">click me</a>
    <h3 ref="myh3">通过ref来获取dom元素对象</h3>
</div>
<script>


    var vm = new Vue({
        el:"#app",
        data:{
            msg:"父组件的属性"
        },
        methods:{
            myClick:function () {
                console.log(this.$refs.myh3)
            }
        },
        //定义实例内部的私有组件
        components:{
            //组件名称：gagaga,模板:balala
            gagaga:{
                template:"#balala"
            }
        }
    })
</script>
</body>
</html>